/*
 * @Author: your name
 * @Date: 2020-08-05 15:38:53
 * @LastEditTime: 2020-10-15 10:14:01
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \tpf-fore\src\core\api\axios.js
 */
import Axios from "axios";
import axios_config from "./axios_config";

const axios = Axios.create(axios_config);

// 请求拦截器
axios.interceptors.request.use(
  function(config) {
    // Do something before request is sent
    console.log(config);
    return config;
  },
  function(error) {
    // Do something with request error
    return Promise.reject(error);
  }
);

// 响应拦截器
axios.interceptors.response.use(
  function(response) {
    // Do something with response data
    return response;
  },
  function(error) {
    // Do something with response error
    return Promise.reject(error);
  }
);

export default axios;
